<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/6/18
  Time: 10:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
    <title>Title</title>
    <%
        pageContext.setAttribute("ctp", request.getContextPath());
    %>
</head>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/employee.css" type="text/css"/>
<script src="${pageContext.request.contextPath}/scripts/jquery-3.0.0.js"></script>
<body>
<h3>欢迎来到员工修改页面</h3>
<!-- modelAttribute：这个表单的所有内容显示绑定的是请求域中 employee的值-->
    <table border="1" cellpadding="5" cellspacing="0" class="uptable">
        <caption>员工修改列表</caption>
        <form:form action="${ctp}/emp/${employee.tid}" modelAttribute="employee" method="post">
            <input type="hidden" name="_method" value="post"/>
            <input type="hidden" name="tid" value="${employee.tid}"/>
            <tr>
                <td>姓名</td>
                <td><form:input path="lastName"/></td>
            </tr>
            <tr>
                <td>gender</td>
                <td>
                    男:<form:radiobutton path="gender" value="1"/>&nbsp;&nbsp;&nbsp;
                    女:<form:radiobutton path="gender" value="2"/>
                </td>
            </tr>
            <tr>
                <td>email</td>
                <td><form:input path="email"/></td>
            </tr>
            <tr>
                <td>部门编号</td>
                <td>
                    <form:select path="department.id"
                                 items="${depts}"
                                 itemLabel="departname"
                                 itemValue="id">

                    </form:select>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="submit" value="修改"/>
                </td>
            </tr>
        </form:form>
    </table>
${employee}<br/>
${department}
</body>
</html>
